package annotation;

import java.lang.annotation.Annotation;
import java.lang.reflect.Field;

/**
 * @author Panbo.Guo
 */
public class Test {

    @B
    private Object object;

    public static void main(String[] args) throws NoSuchFieldException {
        Field field = Test.class.getDeclaredField("object");
        A a = field.getAnnotation(A.class);
        B b = field.getAnnotation(B.class);

        Annotation[] annotations = field.getAnnotations();
        for (Annotation annotation : annotations) {
            A a1 = annotation.annotationType().getAnnotation(A.class);
            if(a1 != null)
                System.out.println(a1);
        }

        System.out.println(a);
        System.out.println(b);
    }
}
